#include<iostream>
#include<vector>
#include "Polynomial.h"
#include "InterConditions.h"

using namespace std;

#ifndef _NEWTONINTERP_H_
#define _NEWTONINTERP_H_


class NewtonInterp
{
private:
  Polynomial interPoly_;                  //the interpolation polynomial 
  vector<vector<double> > diff_table;     //the divided difference table
  vector<double> X_;                      //the points needed by computing divided difference table
public:
  NewtonInterp(InterConditions p);
  void Interpolation_Method1();           //Method One
  void Interpolation_Method2(vector<double> New_X,vector<double>New_f,vector<double> New_m,vector<vector<double> > New_df);           //Method Two,where you can get new polynomial from the previous one if you newly add some interpolation conditions,the meaning of parameters is just the same as the private members in class InterConditions,but its datas are what you newly add.And here suppose datas in New_X are different from before.
  Polynomial get_interPoly_()const;            
  int factorial(int i)const;
  static double Neville_Aitken(InterConditions P, double x);
  ~NewtonInterp(){};
};


#endif
